home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 5 / chrpro3.zip / CFBUDGET.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  4KB  |  152 lines

  1. * Program CFBUDGET - Controls all Church Budget operations
  2. Set talk off
  3. Set bell off
  4. Clear
  5. Select primary
  6. Set deleted on
  7. Set intensity off
  8. Set exact off
  9. ? 'Now loading the CFBUDGET program.'
  10. Do BMEMVARS.CMD
  11. Store T to LEVEL2
  12. Do while LEVEL2
  13.   Save to FMEMVARS
  14.   Erase
  15.   @ 0,1 say chname
  16.   @ 0,60 say curdate
  17.   @ 1,1  say 'DATA DISK = '+D
  18.   @ 2,24 say 'CHURCH BUDGET MANAGER                2-/CFBUDGET/'
  19.   @ 4,9 say  '1)  View/edit the church expenses                     /CFBUDGMO/'
  20.   @ 5,9 say  '2)  Enter church received amounts, by Department      /CFBRECVD/'
  21.   @ 6,9 say  '3)  Print checks of amounts marked to be posted       /CFBUDGPC/'
  22.   @ 7,9 say  '4)  Post accounts with amounts marked to be posted    /CFBUDGPC/'
  23.   @ 8,9 say  '5)  Display payment amounts that were posted on a specified date'
  24.   @ 9,9 say  "6)  Start a new month's budget                        /CFBNEWMO/"
  25.   @ 10,9 say "7)  Start a new year's account"
  26.   @ 11,9 say '8)  Print/display the history of accounts, year-to-date'
  27.   @ 12,9 say '9)  Set Up'
  28. ?
  29. Accept '         Select one of the above operations ("Q" = quit) ' to MSEL
  30. ?
  31. Store 'S' to DF
  32. If !(MSEL)='DISK='
  33.   Store !($(MSEL,6,1)) to D
  34.   ? 'Disk now being set to drive',D
  35.   Save to FMEMVARS
  36. endif
  37. Store $(msel,1,1) to XX
  38. Do while @(xx,'123456789QqDd')=0
  39.   Accept 'Invalid entry. Please enter again ' to XX
  40.   Store $(xx,1,1) to msel
  41. enddo
  42. If msel='9' .or. !(msel)='D'
  43.   If msel='9'
  44.       Do CFBSETUP.CMD
  45.       Clear
  46.       Store T to LEVEL2
  47.       Store '9' to msel
  48.       Do BMEMVARS.CMD
  49.       Save to FMEMVARS
  50.   endif
  51. else
  52. If len(MSEL) > 1                        
  53.   Store !($(msel,2,1)) to XX
  54.   If rank(XX) > 64 .and. rank(XX) < 84
  55.     Store XX to DF
  56.     Set raw on
  57.     ? '         Input file is "ACCOUNT',DF,'".'
  58.     Set raw off
  59.   else
  60.     ? 'Invalid ACCOUNT file special character. "ACCOUNTS" is used.'
  61.   endif
  62. endif
  63. Store D+':ACCOUNT'+DF to MFILE
  64. Select primary
  65. If file(MFILE)
  66.   Use &MFILE index &MFILE
  67. else
  68.   Set raw on
  69.   ? 'ACCOUNT',DF,' file not present on the data disk. '
  70.   Accept 'Perform SET UP to create it. Press <RETURN> ' to xx
  71.   Set raw off
  72.   Store 'D' to msel
  73.   endif
  74. endif
  75.   Do CASE
  76.     CASE MSEL = '1'
  77.       Do CFBUDGMO.CMD
  78.     CASE MSEL = '2'
  79.       Do CFBRECVD.CMD
  80.     CASE MSEL='3'
  81.       Do CFBUDGPC.CMD
  82.     CASE MSEL='4'
  83.       Do CFBUDGPC.CMD
  84.     CASE MSEL='5'
  85.       ? 'The date for account postings is ',date()
  86.       Accept '              Change to . . . .  ' to INDATE
  87.       If INDATE=' '
  88.         Store date() to INDATE
  89.       endif
  90.       Store T to beginng
  91.       Find D
  92.       If #=0
  93.         Accept 'Invalid ACCOUNTS file. Press <RETURN>' to XX
  94.       else
  95.       ?
  96.       ? 'Accounts posted on ',INDATE
  97.       ?
  98.       Do while account='D' .and. .not. EOF
  99.         If .not. beginng
  100.           ? '   ',$(account,4,25),'$ ',newpaid
  101.           SKIP
  102.         endif
  103.         Store F to beginng
  104.         Do while (PP<>'*' .or. newpdate<>indate) .and. .not. eof
  105.           SKIP
  106.         enddo
  107.       enddo
  108.       Accept 'End of POSTINGS list. Press <RETURN> ' to XX
  109.       endif
  110.       Use
  111.       Release indate,xx,beginng
  112.     CASE MSEL = '6'
  113.       Do CFBNEWMO.CMD
  114.     CASE MSEL = '7'
  115.       Use
  116.       Select primary
  117.       Store d+':ACCOUNT'+DF to MFILE
  118.       If .not.file('ACCOUNTZ')
  119.         Accept 'File ACCOUNTZ is not on the program disk. Press <RETURN>' to XX
  120.       else
  121.        ?  'Now about to create a new',MFILE,'file.'
  122.        Accept 'OK?' to XX
  123.        If !(XX)='Y'
  124.         USE ACCOUNTZ
  125.         copy to &MFILE
  126.         use &MFILE
  127.         Index on account to &MFILE
  128.         use
  129.         ? 'File',MFILE,'has now been created as new.'
  130.         Accept 'Press <RETURN> to continue' to XX
  131.        endif
  132.       endif
  133.       Use
  134.     CASE MSEL = '8'
  135. ? curdate,'                Accounts History                  ',MFILE
  136.       ?
  137. ? '        DEPARTMENT           PAIDYTD  PREVOWED   NEWOWED   NEWPAID NEWPDATE'
  138. ?? 'PP'
  139. LIST str(#,3),$(account,1,22),paidytd,prevowed,newowed,newpaid,newpdate,pp OFF
  140.       USE
  141.       ?
  142.       Accept '    - END OF ACCOUNTS FILE -        press <return>' to xx
  143.     CASE !(MSEL) = 'Q'
  144.       Store F to LEVEL2
  145.       RETURN
  146.   ENDCASE
  147. endif
  148. ENDDO
  149. Restore from FMEMVARS
  150. ENDDO
  151. RETURN
  152.